Skip to content

Fix queue group routing, waking and errors across nodes (#111) - #113

Merged
nullata merged 5 commits into
mainfrom
fix/111-phase2-honest-routing
Nov 1, 2026
Merged

nullata merged 5 commits into
mainfrom
fix/111-phase2-honest-routing

Conversation

@nullata

@nullata nullata commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Closes #111.

Draft: needs a run on a real multi-node cluster with real Docker before merging. So far this has only been tested with mocks and fake peers (1205 unit tests).

What changes

  • Requests go to awake models first. A sleeping model's empty queue used to win load ties, so about half the requests could fail with a healthy model idle.
  • A group name works whatever state its model is in. A sleeping or loading member used to give "model not found". It now wakes or is waited on.
  • Concurrent wakes are safe. On Docker, requests arriving together at a sleeping model could delete the container that had just started. Now one wake runs and the others share its result.
  • Sleeping capacity wakes under load. If every healthy member stays full with requests queued for about 15 seconds, one sleeper wakes, if it fits in free VRAM. On by default, and set per node with eager_wake_enabled and eager_wake_polls.
  • Stopped models stay stopped. Nothing is launched on another node to balance load.
  • Listings match what can be served. Groups on offline or view-only nodes are no longer advertised.
  • Errors say what happened. A group no node can serve returns 429 or 503 naming each node and why. A node that can't serve a forwarded request tells the sender to try the next member.
  • /v1/embeddings routes across nodes.

Check on the real cluster

  • A burst of requests at a sleeping model on Docker leaves it running.
  • Eager wake timing, and refusal when the model doesn't fit in VRAM.
  • A mixed-version cluster during an upgrade.

Known gap

If a loading model never becomes ready, the waiting request still gets a generic 500 and doesn't try another node.

Not included

The RELEASENOTES.md entry and translated docs.

…s on a name conflict (#111)

Concurrent wakes all passed the status check, because status stays "sleeping"
until the container is up. On Docker the loser's 409 force-removed the winner's
live container; bare-metal the loser failed and briefly marked it stopped.
#111)

An alias usually names no file, so a request for a sleeping or starting member
died as "model not found", or woke an unrelated file that substring-matched.
Members now rank healthy > starting > sleeping, and the wake runs outside the
global lock. Stopping, stopped and failed wakes return typed 503s, and a
forwarding peer is told to try its next member. Nodes advertise alias_wake.
A sleeping member's gate reads empty, so it won load ties and any backlog, and
queued work migrated onto it as free capacity. Load reports now count healthy,
starting and sleeping members and take free slots from healthy members only.
Dispatch and evacuation try awake members first. Older peers are skipped unless
their snapshot shows a healthy member. Must ship with the eager wake in PR3.
…ed (#111)

With sleepers ranked last and awake gates queueing rather than 429ing, a sleeper
only saw traffic after a whole queue overflowed. A pass beside the heartbeat now
wakes one once every healthy member in the group is full with work queued for
eager_wake_polls polls in a row (default 3). Only the lowest node id holding a
sleeper wakes, at most one per group per pass, and only if it fits free VRAM.
…111)

Listings and routing now share one rule, so groups on view-only and offline
peers are no longer advertised. A peer that fails a load probe stays routable
from its snapshot but ranks last. When no node can take a request, the client
gets a 429 or 503 naming each node and why, not "model not found". /v1/embeddings
now routes across the cluster. Documents queue group behavior in CLUSTERING.md.
@nullata
nullata marked this pull request as ready for review November 1, 2026 16:41
@nullata
nullata marked this pull request as draft November 1, 2026 16:45
@nullata
nullata marked this pull request as ready for review November 1, 2026 23:52
@nullata
nullata merged commit c91581a into main Nov 1, 2026
1 check passed
@nullata
nullata deleted the fix/111-phase2-honest-routing branch November 2, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cluster: queue-group routing picks sleeping members, and no node can serve a group alias unless the member is healthy

1 participant